import React, { useEffect, useState } from 'react'
import { listTableData } from '../../../../api/home'
import { Card, Table } from 'antd';
const { Column } = Table;

function HomeTable() {
  const [data, setData] = useState([])
  useEffect(() => {
    listTableData().then((res) => {
      setData(res.data)
    })
  }, [])
  return (
    <Card hoverable style={{ marginTop: "20px" }}>
      <Table dataSource={data} rowKey={(record) => record.id} pagination={false} >
        <Column title="商品" dataIndex="goods" key="goods" />
        <Column title="今日购买" dataIndex="todayMark" key="todayMark" />
        <Column title="本月购买" dataIndex="monthMark" key="monthMark" />
        <Column title="总购买" dataIndex="totalMark" key="totalMark" />
      </Table>
    </Card>
  )
}

export default HomeTable
